Ext.define('User.controller.User', {
			extend : 'Ext.app.Controller',
			config : {
				refs : {
					panelPage : '#panelPage',
					resersubmit : '#userSubmit',
					regUserSubmit : '#regUserSubmit'
				},
				control : {
					resersubmit : {
						tap : 'login'
					},
					regUserSubmit : {
						tap : 'register'
					}
				}
			},
			login : function(btn, e, eOpts) {
				Ext.data.JsonP.request({
							url : 'http://'+Config.utils.SERVER_IP+':'+Config.utils.SERVER_PORT +'/hotel/login/ajaxlogin',
							callbackKey: 'callback',
							params : {
								username : Ext.getCmp('loginusername').get('value'),
								password : Ext.getCmp('loginpwd').get('value')
							},
							callback : function(success, result) {
								if (result.username == null) {// 返回用户名为空，就判断为空
									Ext.Msg.alert("系统提示", "用户名或密码错误！");
								} else {
									Ext.Viewport.getComponent('panelPage')
											.setActiveItem(1);
								}

							}
						});
			},
			register : function(btn, e, eOpts) {
				Ext.Viewport.getComponent('panelPage').setActiveItem(2);
			}
		});
